//
//  States_and_CapitalsAppDelegate.m
//  States and Capitals
//
//  Created by Ward Fred on 10/25/10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import "States_and_CapitalsAppDelegate.h"

#import "StartViewController.h"

@implementation States_and_CapitalsAppDelegate

@synthesize window;
@synthesize viewController;
@synthesize states;
@synthesize navControl;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    
    
    // Override point for customization after app launch  
	[viewController initWithNibName:@"StartViewController" bundle:[NSBundle mainBundle]];
	viewController.wantsFullScreenLayout = YES;
    [window makeKeyAndVisible];
	navControl = [[UINavigationController alloc] initWithRootViewController:viewController];
	//navControl.wantsFullScreenLayout = NO;
	
    navControl.view.frame = CGRectMake(0, 20, [UIScreen mainScreen].applicationFrame.size.width, [UIScreen mainScreen].applicationFrame.size.height);
	[navControl setNavigationBarHidden:YES];
    window.frame = [UIScreen mainScreen].bounds;
    NSLog(@"main window: %@", NSStringFromCGRect([UIScreen mainScreen].bounds));
	[window addSubview:[navControl view]];
	
	NSString *mainBundlePath = [[NSBundle mainBundle] bundlePath];
	NSString *plistPath = [mainBundlePath stringByAppendingPathComponent:@"StateData.plist"];
	self.states = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
	[navControl setToolbarHidden:YES];
}

-(NSDictionary *)getStates
{
	return states;
}	

- (void)dealloc {
    [super dealloc];
    [viewController release];
    [navControl release];
    [window release];

}


@end
